/*
 * @Date: 2019-08-31 09:15:09
 * @Github: https://github.com/FinnWu
 * @LastEditors: Finnwu
 * @LastEditTime: 2019-08-31 11:52:26
 */

// 替换空格
function replaceSpace(str) {
    // write code here
   return str.replace(/ /g, '%20')
}



console.log(replaceSpace('We Are Happy'))